﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using BeetleX.Http.Clients;
using DEEBCG.ExternalLib.CompanyAPI.Model;

namespace DEEBCG.ExternalLib.CompanyAPI
{
    /// <summary>
    /// 获取Client接口类
    /// </summary>
    [Controller(BaseUrl = "/api/Client/")]
    public interface IClient
    {
        /// <summary>
        /// 获取指定客户信息
        /// </summary>
        /// <param name="id">用户编号</param>
        /// <returns></returns>
        [Get]
        Task<ResultInfo<ClientUserInfo>> Get(string id, [Header("DEEBCG")] string token);

        /// <summary>
        /// 获取客户列表
        /// </summary>
        /// <param name="companyID">客户所属机构编号</param>
        /// <param name="key">关键词</param>
        /// <param name="page">当前页码</param>
        /// <param name="pageSize">分页大小</param>
        /// <returns></returns>
        [Get]
        Task<ResultInfo<PageDataInfo<IList<ClientUserInfo>>>> GetList(string companyID, [Query] string key, int page, int pageSize, [Header("DEEBCG")]string token);

        /// <summary>
        /// 添加客户
        /// </summary>
        /// <param name="info">客户信息</param>
        /// <returns></returns>
        /// <remarks>添加时无法指定绑定设备编号，通过绑定解绑设备的方法处理</remarks>
        [Post]
        Task<ResultInfo<string>> Add(ClientUserInfo info, [Header("DEEBCG")] string token);


        /// <summary>
        /// 更新用户信息
        /// </summary>
        /// <param name="info">客户信息</param>
        /// <returns></returns>
        /// <remarks>更新时无法指定绑定设备编号，通过绑定解绑设备的方法处理</remarks>
        [Put]
        Task<ResultInfo<string>> Update(ClientUserInfo info, [Header("DEEBCG")] string token);


        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="id">用户编号</param>
        /// <returns></returns>
        [Del]
        Task<ResultInfo<string>> Delete(string id, [Header("DEEBCG")] string token);
    }
}
